Skip to content

Two perf fixes#45

Merged
cgwalters merged 2 commits into
mainfrom
perf-fixes
Apr 3, 2026
Merged

Two perf fixes#45
cgwalters merged 2 commits into
mainfrom
perf-fixes

Conversation

@cgwalters

Copy link
Copy Markdown
Owner

No description provided.

… /pods

The list_pods_unified handler was creating 2N Docker connections and
doing 2N inspect_container calls for N running pods: one set from
get_pod_api_port (via fetch_agent_status_for_pod) and another from
get_pod_forwarded_ports, both inspecting the same container.

Replace these with a single shared bollard::Docker connection (wrapped
in Arc for the spawned tasks) and a new inspect_pod_ports() function
that does one inspect_container call per pod and extracts both the
pod-api host port and forwarded ports from the result.

This halves the number of Docker socket round-trips per /pods request
and eliminates repeated connection setup overhead.

Assisted-by: OpenCode (Claude Opus 4)
When the /pods endpoint is slow (e.g. with many running pods), the
fixed 5-second setInterval fires before the previous request returns,
causing multiple concurrent requests to stack up.

Replace setInterval with setTimeout loops that only schedule the next
poll after the current one completes. This makes request pileup
structurally impossible rather than relying on a runtime guard.

The same pattern is applied to all three pollers (pods, launches,
proposals) in the SolidJS context and to the agent-wrapper.js pod
list poll. A disposed flag prevents stale polls after cleanup.

Assisted-by: OpenCode (Claude Opus 4)
@cgwalters cgwalters enabled auto-merge April 3, 2026 21:36
@cgwalters cgwalters merged commit ed5bc1b into main Apr 3, 2026
3 checks passed
@cgwalters cgwalters deleted the perf-fixes branch April 3, 2026 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant